/*
 *    Copyright (c) 2018-2025, lengleng All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: lengleng (wangiegie@gmail.com)
 */

package com.pig4cloud.pigx.contract.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.pig4cloud.pigx.common.core.util.R;
import com.pig4cloud.pigx.contract.bo.ContractExistPositionInfoBO;
import com.pig4cloud.pigx.contract.dto.AppContractMarginChangeDTO;
import com.pig4cloud.pigx.contract.dto.AppContractMultipleChangeDTO;
import com.pig4cloud.pigx.contract.entity.ContractPosition;
import com.pig4cloud.pigx.contract.vo.ContractRankingVO;

/**
 * 仓位表
 *
 * @date 2022-08-11 10:08:43
 */
public interface ContractPositionService extends IService<ContractPosition> {

    /**
     * 获取多宝比
     *
     * @return
     */
    R getProportion();

    /**
     * 获取盈利榜
     *
     * @return
     */
    IPage<ContractRankingVO> getProfitRanking(Page page);

    /**
     * 获取亏损榜
     *
     * @return
     */
    IPage<ContractRankingVO> getLossRanking(Page page);

    /**
     * 修改杠杆倍数
     *
     * @param dto dto
     * @date 2022/9/2 14:58
     */
    void multipleChange(AppContractMultipleChangeDTO dto);

    /**
     * 逐仓调整保证金
     *
     * @param dto dto
     * @date 2022/9/6 22:02
     */
    void marginChange(AppContractMarginChangeDTO dto);

    /**
     * 查询已有仓位信息
     *
     * @param symbolId 币对id
     * @return {@link ContractExistPositionInfoBO}
     * @since 2022/9/30 10:27
     */
    ContractExistPositionInfoBO existInfo(Long symbolId);
}
